package demo15;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextInt()) {
            int n = scanner.nextInt();
            int count = 0;
            for (int i = 0; i < 32; i++) {
                if((n & 1) == 1) {
                    count++;
                }
                n = n >>> 1;
            }
            System.out.println(count);
        }
    }
}
